const WECHAT_LOGIN = {
  state: {
    access_token: "",
    refresh_token: "",
    openid: "",
    unionid: ""
  },
  mutations: {
    SET_ACCESS_TOKEN: (state, access_token) => {
      state.access_token = access_token;
    },
    SET_REFRESH_TOKEN: (state, refresh_token) => {
      state.refresh_token = refresh_token;
    },
    SET_OPENID_TOKEN: (state, openid) => {
      state.openid = openid;
    },
    SET_UNIONID_TOKEN: (state, unionid) => {
      state.unionid = unionid;
    }
  },
  actions: {
    setWechatLoginData({
      commit
    }, obj) {
      commit("SET_ACCESS_TOKEN", obj["access_token"]);
      commit("SET_ACCESS_TOKEN", obj["refresh_token"]);
      commit("SET_ACCESS_TOKEN", obj["openid"]);
      commit("SET_ACCESS_TOKEN", obj["unionid"]);
    }
  }
};

export default WECHAT_LOGIN;
